package ${package.ServiceImpl};

import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${package.Service}.${table.serviceName};
import ${package.Mapper}.${table.mapperName};
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.hjysmart.hjyapp.common.page.PageQuery;
/**
 * <p>
 * ${table.comment!} 服务实现类
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
@Service
<#if kotlin>
open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} {

}
<#else>
public class ${table.serviceImplName}  implements ${table.serviceName} {

    @Resource
    private ${table.mapperName} ${entityInstance}Mapper;

    @Resource
    private ${entity}DtoConvert ${entityInstance}DtoConvert;

    @Override
    public PageQueryResult<${entity}Dto> pageList(PageQuery queryParam,${entity}Vo ${entityInstance}Vo){

        Page<${entity}> ${entityInstance}s = PageHelper.startPage(queryParam.getPageNumber(), queryParam.getPageSize())
            .doSelectPage(() -> ${entityInstance}Mapper.selectList(${entityInstance}Vo))
            .setOrderBy(queryParam.buildOrderString());
        return new PageQueryResult<>(${entityInstance}DtoConvert.toOtherList(exportFileRecords.getResult()), (int) ${entityInstance}s.getTotal());
    }
    @Override
    public int add${entity}(${entity}Vo ${entityInstance}Vo){

    }
    @Override
    public int update${entity}(${entity}Vo ${entityInstance}Vo){

    }
    @Override
    public int deleteByIds(Long[] ids){
        return 0;
    }

}
</#if>
